<html>
<head>
<title>firstworks   Configuring SQL Relay</title>
<link href="css/styles.css" rel="stylesheet">
</head>
<body>

<span class="heading1">Configuring SQL Relay</span><br><br>

<p>The SQL Relay configuration file
(usually /usr/local/firstworks/etc/sqlrelay.conf) may be edited by hand.</p>

<p>The file format is complicated and is best explained with an example.</p>

<blockquote>
<pre>
<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;instances <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">instance</font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>
<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;instance <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">users</font><font color="#008b8b">,</font><font color="#ff00ff">connections</font><font color="#008b8b">?,</font><font color="#ff00ff">router</font><font color="#008b8b">?</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance id <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;defaultid&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance addresses <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;0.0.0.0&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance port <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;9000&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance socket <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;/tmp/sqlrelay.socket&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance dbase <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">oracle8</font><font color="#008b8b">|</font><font color="#ff00ff">mysql</font><font color="#008b8b">|</font><font color="#ff00ff">postgresql</font><font color="#008b8b">|</font><font color="#ff00ff">sqlite</font><font color="#008b8b">|</font><font color="#ff00ff">freetds</font><font color="#008b8b">|</font><font color="#ff00ff">sybase</font><font color="#008b8b">|</font><font color="#ff00ff">odbc</font><font color="#008b8b">|</font><font color="#ff00ff">db2</font><font color="#008b8b">|</font><font color="#ff00ff">firebird</font><font color="#008b8b">|</font><font color="#ff00ff">mdbtools</font><font color="#008b8b">|</font><font color="#ff00ff">router</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;oracle8&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance connections <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxconnections <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxqueuelength <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;0&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance growby <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance ttl <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;60&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxsessioncount <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;10&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance endofsession <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">commit</font><font color="#008b8b">|</font><font color="#ff00ff">rollback</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;commit&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance sessiontimeout <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;60&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance runasuser <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;nobody&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance runasgroup <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;nobody&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance cursors <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;5&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance authtier <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">listener</font><font color="#008b8b">|</font><font color="#ff00ff">connection</font><font color="#008b8b">|</font><font color="#ff00ff">listener_and_connection</font><font color="#008b8b">|</font><font color="#ff00ff">database</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;listener&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance handoff <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">pass</font><font color="#008b8b">|</font><font color="#ff00ff">reconnect</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;reconnect&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance deniedips <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance allowedips <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance debug <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">none</font><font color="#008b8b">|</font><font color="#ff00ff">listener</font><font color="#008b8b">|</font><font color="#ff00ff">connection</font><font color="#008b8b">|</font><font color="#ff00ff">listener_and_connection</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;none&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxquerysize <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;65536&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxstringbindvaluelength <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;4000&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxlobbindvaluelength <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;71680&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance idleclienttimeout <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance maxlisteners <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance listenertimeout <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;0&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance reloginatstart <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">yes</font><font color="#008b8b">|</font><font color="#ff00ff">no</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance timequeriessec <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;instance timequeriesusec <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&gt;</font>

<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;users <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">user</font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>
<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;user <font color="#008b8b">EMPTY</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;user user <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;user&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;user password <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;password&quot;</font><font color="#008b8b">&gt;</font>

<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;connections <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">connection</font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>
<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;connection <font color="#008b8b">EMPTY</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;connection connectionid <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;defaultid&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;connection string <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;user=scott;password=tiger&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;connection metric <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;connection behindloadbalancer <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">yes</font><font color="#008b8b">|</font><font color="#ff00ff">no</font><font color="#2e8b57"><b>)</b></font>&nbsp;<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">&gt;</font>

<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;router <font color="#2e8b57"><b>((</b></font><font color="#ff00ff">route</font><font color="#008b8b">*|</font><font color="#ff00ff">filter</font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>
<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;route <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">query</font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;route host <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;route port <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;route socket <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;route user <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;route password <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>

<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;filter <font color="#2e8b57"><b>(</b></font><font color="#ff00ff">query</font><font color="#008b8b">*</font><font color="#2e8b57"><b>)</b></font><font color="#008b8b">&gt;</font>

<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ELEMENT</b></font>&nbsp;query <font color="#008b8b">EMPTY</font><font color="#008b8b">&gt;</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>ATTLIST</b></font>&nbsp;query pattern <font color="#2e8b57"><b>CDATA</b></font>&nbsp;<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&gt;</font>
</font>
</pre>
</blockquote>

<p>As you can see, it's an XML file.  Below is its DTD.</p>

<blockquote>
<font color="#0000ff">&lt;?</font><font color="#2e8b57"><b>xml</b></font><font color="#2e8b57"><b>&nbsp;</b></font><font color="#2e8b57"><b>version</b></font>=<font color="#ff00ff">&quot;1.0&quot;</font><font color="#0000ff">?&gt;</font><br>
<font color="#008b8b">&lt;!</font><font color="#a52a2a"><b>DOCTYPE</b></font>&nbsp;instances <font color="#a52a2a"><b>SYSTEM</b></font>&nbsp;<font color="#ff00ff">&quot;sqlrelay.dtd&quot;</font><font color="#008b8b">&gt;</font><br>
<br>
<font color="#008b8b">&lt;</font><font color="#008b8b">instances</font><font color="#008b8b">&gt;</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">&lt;!</font><font color="#0000ff">-- Regular SQL Relay Instance --</font><font color="#0000ff">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">instance</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>id</b></font>=<font color="#ff00ff">&quot;example&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>port</b></font>=<font color="#ff00ff">&quot;9000&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>socket</b></font>=<font color="#ff00ff">&quot;/tmp/example.socket&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>dbase</b></font>=<font color="#ff00ff">&quot;oracle8&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>connections</b></font>=<font color="#ff00ff">&quot;3&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxconnections</b></font>=<font color="#ff00ff">&quot;15&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxqueuelength</b></font>=<font color="#ff00ff">&quot;5&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>growby</b></font>=<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>ttl</b></font>=<font color="#ff00ff">&quot;60&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxsessioncount</b></font>=<font color="#ff00ff">&quot;10&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>endofsession</b></font>=<font color="#ff00ff">&quot;commit&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>sessiontimeout</b></font>=<font color="#ff00ff">&quot;600&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>runasuser</b></font>=<font color="#ff00ff">&quot;nobody&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>runasgroup</b></font>=<font color="#ff00ff">&quot;nobody&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>cursors</b></font>=<font color="#ff00ff">&quot;5&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>authtier</b></font>=<font color="#ff00ff">&quot;listener&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>handoff</b></font>=<font color="#ff00ff">&quot;pass&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>deniedips</b></font>=<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>allowedips</b></font>=<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>debug</b></font>=<font color="#ff00ff">&quot;none&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxquerysize</b></font>=<font color="#ff00ff">&quot;65536&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxstringbindvaluelength</b></font>=<font color="#ff00ff">&quot;4000&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxlobbindvaluelength</b></font>=<font color="#ff00ff">&quot;71680&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>idleclienttimeout</b></font>=<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxlisteners</b></font>=<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>listenertimeout</b></font>=<font color="#ff00ff">&quot;0&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>reloginatstart</b></font>=<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>timequeriessec</b></font>=<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>timequeriesusec</b></font>=<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">users</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">user</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;user1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;password1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">user</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;user2&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;password2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">user</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;user3&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;password3&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/users&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">connections</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">connection</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>connectionid</b></font>=<font color="#ff00ff">&quot;db1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>string</b></font>=<font color="#ff00ff">&quot;user=exampleuser1;password=examplepassword1;oracle_sid=EXAMPLE1;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>metric</b></font>=<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>behindloadbalancer</b></font>=<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">connection</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>connectionid</b></font>=<font color="#ff00ff">&quot;db2&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>string</b></font>=<font color="#ff00ff">&quot;user=exampleuser2;password=examplepassword2;oracle_sid=EXAMPLE2;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>metric</b></font>=<font color="#ff00ff">&quot;3&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>behindloadbalancer</b></font>=<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">connection</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>connectionid</b></font>=<font color="#ff00ff">&quot;db3&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>string</b></font>=<font color="#ff00ff">&quot;user=exampleuser3;password=examplepassword3;oracle_sid=EXAMPLE3;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>metric</b></font>=<font color="#ff00ff">&quot;5&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>behindloadbalancer</b></font>=<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">connection</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>connectionid</b></font>=<font color="#ff00ff">&quot;db4&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>string</b></font>=<font color="#ff00ff">&quot;user=exampleuser4;password=examplepassword4;oracle_sid=EXAMPLE4;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>metric</b></font>=<font color="#ff00ff">&quot;6&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>behindloadbalancer</b></font>=<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/connections&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/instance&gt;</font><br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">&lt;!</font><font color="#0000ff">-- Query Router/Filter --</font><font color="#0000ff">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">instance</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>id</b></font>=<font color="#ff00ff">&quot;routerexample&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>port</b></font>=<font color="#ff00ff">&quot;9001&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>socket</b></font>=<font color="#ff00ff">&quot;/tmp/example.socket&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>dbase</b></font>=<font color="#ff00ff">&quot;router&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>connections</b></font>=<font color="#ff00ff">&quot;3&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxconnections</b></font>=<font color="#ff00ff">&quot;15&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxqueuelength</b></font>=<font color="#ff00ff">&quot;5&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>growby</b></font>=<font color="#ff00ff">&quot;1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>ttl</b></font>=<font color="#ff00ff">&quot;60&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxsessioncount</b></font>=<font color="#ff00ff">&quot;10&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>endofsession</b></font>=<font color="#ff00ff">&quot;commit&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>sessiontimeout</b></font>=<font color="#ff00ff">&quot;600&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>runasuser</b></font>=<font color="#ff00ff">&quot;nobody&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>runasgroup</b></font>=<font color="#ff00ff">&quot;nobody&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>cursors</b></font>=<font color="#ff00ff">&quot;5&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>authtier</b></font>=<font color="#ff00ff">&quot;listener&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>handoff</b></font>=<font color="#ff00ff">&quot;pass&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>deniedips</b></font>=<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>allowedips</b></font>=<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>debug</b></font>=<font color="#ff00ff">&quot;none&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxquerysize</b></font>=<font color="#ff00ff">&quot;65536&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxstringbindvaluelength</b></font>=<font color="#ff00ff">&quot;4000&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxlobbindvaluelength</b></font>=<font color="#ff00ff">&quot;71680&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>idleclienttimeout</b></font>=<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>maxlisteners</b></font>=<font color="#ff00ff">&quot;-1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>listenertimeout</b></font>=<font color="#ff00ff">&quot;0&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>reloginatstart</b></font>=<font color="#ff00ff">&quot;no&quot;</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">users</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">user</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;user1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;password1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">user</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;user2&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;password2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">user</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;user3&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;password3&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/users&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">router</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">&lt;!</font><font color="#0000ff">-- send all queries for table1 to host1 --</font><font color="#0000ff">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">route</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>host</b></font>=<font color="#ff00ff">&quot;host1&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>port</b></font>=<font color="#ff00ff">&quot;9000&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>socket</b></font>=<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;host1user&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;host1password&quot;</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*select\s+.*\s+from\s+table1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*insert\s+into\s+table1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*update\s+table1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*delete\s+from\s+table1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*drop\s+table\s+table1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*create\s+table\s+table1&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/route&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">&lt;!</font><font color="#0000ff">-- filter out any queries for table2 --</font><font color="#0000ff">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">filter</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*select\s+.*\s+from\s+table2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*insert\s+into\s+table2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*update\s+table2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*delete\s+from\s+table2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*drop\s+table\s+table2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;^\s*create\s+table\s+table2&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/filter&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">&lt;!</font><font color="#0000ff">-- send any other queries to host2 --</font><font color="#0000ff">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">route</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>host</b></font>=<font color="#ff00ff">&quot;host2&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>port</b></font>=<font color="#ff00ff">&quot;9000&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>socket</b></font>=<font color="#ff00ff">&quot;&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>user</b></font>=<font color="#ff00ff">&quot;host2user&quot;</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>password</b></font>=<font color="#ff00ff">&quot;host2password&quot;</font><font color="#008b8b">&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;</font><font color="#008b8b">query</font><font color="#008b8b">&nbsp;</font><font color="#2e8b57"><b>pattern</b></font>=<font color="#ff00ff">&quot;.*&quot;</font><font color="#008b8b">/&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/route&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/router&gt;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#008b8b">&lt;/instance&gt;</font><br>
<br>
<font color="#008b8b">&lt;/instances&gt;</font><br>
</font>
</blockquote>

<p>So what do all these tags do?</p>

<p>The <b>instances</b> tag is just the root tag.  The sqlrelay.conf
file should have only one of these tags surrounding all other tags.</p>

<p>Each <b>instance</b> tag defines an instance of sqlrelay.  An
instance consists of one sqlr-listener and one or more sqlr-connection daemons.
You can define as many of these as you like.</p>

<p>The <b>users</b> tag surrounds the list of users that may connect to
the instance.</p>

<p>Each <b>user</b> tag defines a user/password combination that
may be used to connect to the instance.</p>

<p>The <b>connections</b> tag surrounds the list of sqlr-connection
daemon configurations used by the instance.</p>

<p>Each <b>connection</b> tag defines a sqlr-connection daemon 
configuration.  In most cases, there will be only 1 of these tags.  In cases
where clustered or replicated databases are used, the sqlr-connection daemons 
may need to be able to connect to multiple machines.  In that case, there would
be more than 1 line here.  See <a href="loadbalfailover.html">SQL Relay Load
Balancing and Failover</a> for more information.</p>

<p>The <b>router</b> tag sets up the instance to route and filter queries to
other SQL Relay instances.  If this tag is present, the instance should contain
no <b>connections</b> tags.  See <a href="router.html">Routing and Filtering Queries with SQL Relay</a> for detailed information about configuring SQL Relay to route and filter quries.</p>

<p>The <b>route</b> tag designates an instance of SQL Relay to route queries
to.  It should contain a set of <b>query</b> tags defining which queries
to route to the designated instance.  This tag is only valid inside a
<b>router</b> tag.</p>

<p>The <b>filter</b> tag defines a set of queries to be filtered out (ie.
if a client sends one of these queries, the SQL Relay server won't run it
against the database and will simply return an error).  This tag is only valid
inside a <b>router</b> tag.</p>

<p>The <b>query</b> tag defines a regular expression which the <b>route</b>
and <b>filter</b> tags use to match queries.</p>

<p>Below is a description of the attributes for each tag.</p>

<ul>
<li><b>instance</b>
<ul>
<li><b>id</b> - the ID of this instance</li>
<li><b>addresses</b> - A comma-delimited list of addresses that the sqlr-listener and sqlr-connection daemons should bind to.  If absent or set to 0.0.0.0, they will bind to all addresses.</li>
<li><b>port</b> - the port the listener should listen on (note, if multiple instances are configured with the same port or socket, they cannot be run at the same time)</li>
<li><b>socket</b> - the unix socket (filename) the listener should listen on (note, if multiple instances are configured with the same port or socket, they cannot be run at the same time)</li>
<li><b>dbase</b> - the type of database the connection daemon should connect to.  Should be one of: oracle8, mysql, postgresql, sqlite, freetds, sybase, odbc, db2, firebird or mdbtools</li>
<li><b>connections</b> - the number of sqlr-connection daemons to start up when using sqlr-start.</li>
<li><b>maxconnections</b> - the maximum number of sqlr-connection daemons to scale to.</li>
<li><b>maxqueuelength</b> - the size the queue of waiting clients has to grow to before more connections will be spawned.</li>
<li><b>growby</b> - the number of connections that will be started up when new connections are spawned.</li>
<li><b>ttl</b> - the amount of time that an idle connection will stay alive after being spawned dynamically (does not apply to connections spawned by sqlr-start).</li>
<li><b>maxsessioncount</b> - The number of client sessions that a connection will handle after being spawned dynamically before shutting down, even if it never goes idle.  Setting this to 0 will cause the connection to only shut down if it does idle for longer than <b>ttl</b> seconds.  This parameter does not apply to connections spawned by sqlr-start.</li>
<li><b>endofsession</b> - the command to issue when a client ends its session or dies.  Should be either commit or rollback.</li>
<li><b>sessiontimeout</b> - if a client leaves a session open for another client to pick up but no client picks it up, the session will time out after this interval.</li>
<li><b>runasuser</b> - the user to run the sqlr-listener, sqlr-connections and sqlr-scaler as.</li>
<li><b>runasgroup</b> - the group to run the sqlr-listener and sqlr-connections and sqlr-scaler as.</li>
<li><b>cursors</b> - the number of open database cursors to maintain</li>
<li><b>authtier</b> - where to authenticate, see note below</li>
<li><b>handoff</b> - method for handing off a client from listener to connection, can be one of: reconnect or pass, see note below</li>
<li><b>deinedips</b> - a <a href="http://www.regular-expressions.info">regular expression</a> indicating which IP addresses will be denied access (for example, to deny access to all clients: deniedips=".*")</li>
<li><b>allowedips</b> - a <a href="http://www.regular-expressions.info">regular expression</a> indicating which IP addresses will be allowed access, overriding deniedips (for example, to allow access to clients from the 192.168.2.0 and 64.45.22.0 networks: allowedips="(192\.168\.2\..*|64\.45\.22\..*)")</li>
<li><b>debug</b> - instructs the listener and/or connection daemons to log debugging information when sqlr-start is run with the -debug option, see note 
below</li>
<li><b>maxquerysize</b> - sets the maximum query length that the SQL Relay
server will accept, if a client tries to send a longer query, the server will
close the connection (defaults to 64k bytes)</li>
<li><b>maxstringbindvaluelength</b> - sets the maximum length of a string 
bind value that the SQL Relay server will accept, if the client tries to send a
longer string bind value, the server will close the connection (defaults to
32k bytes)</li>
<li><b>maxlobbindvaluelength</b> - sets the maximum length of a LOB/CLOB
bind value that the SQL Relay server will accept, if the client tries to send a
longer LOB/CLOB bind value, the server will close the connection (defaults to
70k bytes)</li>
<li><b>idleclienttimeout</b> - sets the number of seconds that a client can
sit idle while logged into the SQL Relay server before it will be disconnected
(defaults to -1 which means forever)</li>
<li><b>maxlisteners</b> - When a client connects to the listener but no
connections are available, a child listener is forked off to wait for an
available connection.  Since these can pile up and consume system resources,
this parameter allows you to limit the number of child listeners that can be
running simultaneously before an error will be returned to the client.  Set to
-1 (the default) to run without a limit.</li>
<li><b>listenertimeout</b> - sets the number of seconds that a listener will
wait for an avaialable connection before giving up, 0 (the default) means wait
forever</li>
<li><b>reloginatstart</b> - When SQL Relay starts up, it attempts to log into
the database.  If this parameter is set to yes, then if the login fails,
SQL Relay will fork off into the background and attempt to log in over and until
it succeeds or until it is shut down.  If this parameter is set to no, then
if the login fails, SQL Relay will print out an error and exit.</li>
<li><b>timequeriessec</b> and <b>timequeriesusec</b> - These parameters allow
you to log queries which take longer than a certain amount of time to run.
If either is set to -1, the default, no logging will occur.  If both are set
to a number other than -1, then any query which takes longer than
<b>timequeriessec</b> seconds and <b>timequeriesusec</b> milliseconds will be
written out to a log file.  The log file will be in the location:
/usr/local/firstworks/var/sqlrelay/debug/sqlr-connection-<i>id</i>-querylog.<i>pid</i>
where <i>id</i> is the ID of the instance and <i>pid</i> is the process ID of
the connection daemon that ran the query.  Setting both parameters to 0 will
cause all queries to be logged.  Setting either to -1 will cause no queries
to be logged.</li>
</ul>
<li><b>user</b>
<ul>
<li><b>user</b> - the user name required to connect to the listener</li>
<li><b>password</b> - the password required to connect to the listener</li>
</ul>
<li><b>connection</b>
<ul>
<li><b>connectionid</b> - the ID of this connection</li>
<li><b>string</b> - the database connect string the connection daemon should use</li>
<ul>
<li>For <b>oracle8</b> databases, the connect string syntax is "user=USER;password=PASSWORD;oracle_sid=ORACLE_SID;oracle_home=ORACLE_HOME;nls_lang=NLS_LANG;autocommit=yes/no;fetchatonce=FETCHATONCE;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE"
<ul>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>oracle_sid</b>: Which Oracle SID to use.  Optional if
the ORACLE_SID environment variable is set.  Overrides the ORACLE_SID 
environment variable.  This parameter can either be an SID name corresponding
to an entry in the tnsnames.ora file such as:
<blockquote><i>oracle_sid=ora1</i></blockquote>
or a tnsnames-style expression such as:
<blockquote>
<i>oracle_sid=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora1)))</i></blockquote></li>
<li><b>oracle_home</b>: The base directory of the oracle installation to use.
Optional if the ORACLE_HOME environment variable is set.  The SID will be looked
up in $ORACLE_HOME/network/admin/tnsnames.ora</li>
<li><b>nls_lang</b>: The NLS_LANG to use.  Optional if the NLS_LANG environment
variable is set.  Overrides the NLS_LANG environment variable.</li>
<li><b>autocommit</b>: Whether to commit each insert, update or delete
immediately or not.  Optional, defaults to no.</li>
<li><b>fetchatonce</b>: The number of rows that SQL Relay fetches from the database in each round trip.  Defaults to 10. (see
<a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
<li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256. (see <a href="tuning.html#memoryusage">here</a>
for more info on this parameter)</li>
<li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Fields longer than that will be truncated.  Defaults to 32768. (see
<a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
</ul>
</li>
<li>For <b>mysql</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DB;host=HOST;port=PORT;socket=SOCKET;fakebinds=FAKEBINDS"
<ul>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>db</b>: The database to log into.  Required.</li>
<li><b>host</b>: The host to connect to.  Required.</li>
<li><b>port</b>: The port to connect to on a remote host.
Optional, defaults to 3306.</li>
<li><b>socket</b>: The unix socket to connect to.  Optional if host and/or port
are specified.  Overrides host/port.  host and port are optional if socket is
specified.</li>
<li><b>fakebinds</b>: MySQL 4.1.2 supports bind variables natively.  Versions
prior to 4.1.2 did not, and SQL Relay had to substitute the values of bind
variables into the query itself (fake binds).  In MySQL 4.1.2, bind variables
are identified by ?'s in the query, while in versions prior to 4.1.2, bind
variables are identified by :var1, :var2, :var3, etc.  Converting queries
and code which was written to use the older syntax to use MySQL 4.1.2 syntax
can be a lot of work, so this parameter is provided to make code which was
written to run against older versions of MySQL work against MySQL 4.1.2.  This
parameter may be set to "yes" (meaning allow only older syntax and fake binds)
or "no" (meaning only allow MySQL 4.1.2 syntax and use native binds).</li>
</ul>
</li>
<li>For <b>postgresql</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DB;host=HOST;port=PORT;options=OPTIONS;typemangling=MANGLING;fakebinds=FAKEBINDS;"
<ul>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>db</b>: The database to log into.  Required.</li>
<li><b>host</b>: The host to connect to.  Required.  If host begins with a 
slash (/) then it is assumed to be the directory containing a unix socket 
starting with .s.PGSQL.</li>
<li><b>port</b>: The port to connect to on a remote host.
Optional, defaults to 5432.  If host refers to a unix socket, then port is
the extension on the socket name (eg. /tmp/.s.PGSQL.5432).</li>
<li><b>options</b>: Command line options to be sent to the server.
Optional.</li>
<li><b>typemangling</b>: If set to "yes" then column types are translated to standard types.  If set to "lookup" then the pg_type table is queried at startup and column type names are returned as they appear in that table.  By default (or if set to "no"), the type number is returned.</li>
<li><b>fakebinds</b>: Postgresql 8 supports bind variables natively.  Versions
prior to 8 did not, and SQL Relay had to substitute the values of bind variables
into the query itself (fake binds).  In Postgresql 8, bind variables are
identified by $1, $2, $3, etc. in the query, while in versions prior to 8, 
bind variables are identified by :var1, :var2, :var3, etc.  Converting queries
and code which was written to use Postgresql 7 syntax to use Postgresql 8 syntax
can be a lot of work, so this parameter is provided to make code which was
written to run against Postgresql 7 work against Postgresql 8.  This parameter
may be set to "yes" (meaning allow only Postgresql 7 syntax and fake binds) or
"no" (meaning only allow Postgresql 8 syntax and use native binds).</li>
</ul>
</li>
<li>For <b>sqlite</b> databases, the connect string syntax is "db=DB;"
<ul>
<li><b>db</b>: The filename of the database open.  Required.</li>
</ul>
</li>
<li>For <b>freetds</b> databases, the connect string syntax is "sybase=SYBASE;user=USER;password=PASSWORD;server=SERVER;db=DATABASE;charset=CHARSET;language=LANGUAGE;hostname=HOSTNAME;packetsize=PACKETSIZE;"
<ul>
<li><b>sybase</b>: The directory containing the "interfaces" or "freetds.conf"
file.  Optional if the SYBASE environment variable is set.  Overrides the
SYBASE environment variable.</li>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>server</b>: The entry in the "interfaces" or "freetds.conf" file which
specifies host, port and other database connection parameters.</li>
<li><b>db</b>: The database to log into.  Required.</li>
<li><b>charset</b>: The character set to use.  Optional.</li>
<li><b>language</b>: The language to use.  Optional.</li>
<li><b>hostname</b>: The host to connect to.  Optional, overrides the host in
the "interfaces" or "freetds.conf" file.</li>
<li><b>packetsize</b>: The packetsize to use.  Optional.</li>
</ul>
</li>
<li>For <b>sybase</b> databases, the connect string syntax is "sybase=SYBASE;lang=LANG;user=USER;password=PASSWORD;server=SERVER;db=DATABASE;charset=CHARSET;language=LANGUAGE;hostname=HOSTNAME;packetsize=PACKETSIZE;"
<ul>
<li><b>sybase</b>: The directory containing the "interfaces" or "freetds.conf"
file.  Optional if the SYBASE environment variable is set.  Overrides the
SYBASE environment variable.</li>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>server</b>: The entry in the "interfaces" or "freetds.conf" file which
specifies host, port and other database connection parameters.</li>
<li><b>db</b>: The database to log into.  Required.</li>
<li><b>charset</b>: The character set to use.  Optional.</li>
<li><b>language</b>: The language to use.  Optional.</li>
<li><b>hostname</b>: The host to connect to.  Optional, overrides the host in
the "interfaces" or "freetds.conf" file.</li>
<li><b>packetsize</b>: The packetsize to use.  Optional.</li>
</ul>
</li>
<li>For <b>odbc</b> databases, the connect string syntax is "user=USER;password=PASSWORD;dsn=DSN;autocommit=yes/no;"
<ul>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>dsn</b>: The entry in the the odbcinst.ini which specifies host, port
and other database connection parameters.</li>
<li><b>autocommit</b>: Whether to commit each insert, update or delete
immediately or not.  Optional, defaults to no.</li>
</ul>
</li>
<li>For <b>db2</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DB;autocommit=yes/no;"
<ul>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>db</b>: The server instance to connect to.</li>
<li><b>autocommit</b>: Whether to commit each insert, update or delete
immediately or not.  Optional, defaults to no.</li>
</ul>
</li>
<li>For <b>firebird</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DATABASE;dialect=DIALECT;autocommit=yes/no;"
<ul>
<li><b>user</b>: The username SQL Relay should use to log into the
database.  Required.</li>
<li><b>password</b>: The password SQL Relay should use to log into the
database.  Required.</li>
<li><b>db</b>: The filename of the database open.  Required.</li>
<li><b>dialect</b>: The database dialect to use.  Optional, defaults to 3.</li>
<li><b>autocommit</b>: Whether to commit each insert, update or delete
immediately or not.  Optional, defaults to no.</li>
</ul>
</li>
<li>For <b>mdbtools</b> databases, the connect string syntax is "db=DATABASE;"
<ul>
<li><b>db</b>: The filename of the database open.  Required.</li>
</ul>
</li>
</ul>
<li><b>metric</b> - a number that influences how many of this connection should be started</li>
<li><b>behindloadbalancer</b> - Whether the database is really a pool of databases behind a load balancer or not.  If the database is not a pool of databases behind a load balancer, then when a connection daemon determines that the database has gone down, it will cause all connection daemons connected to that database to log out and re-login.  However, if the database is really a pool of databases behind a load balancer, and a connection daemon determines that the database has gone down, only that connection will log out and re-login as some or all of the remaining connections may not actually be connected to the same physical database machine, but rather to a clone which has not actually gone down.</li>
</ul>
<li><b>route</b></li>
<ul>
<li><b>host</b> - The host that the SQL Relay server that queries will be routed to is running on.</li>
<li><b>port</b> - The port that the SQL Relay server that queries will be routed to is listening on.</li>
<li><b>socket</b> - The socket that the SQL Relay server that queries will be routed to is listening on.  Only use this if the SQL Relay server that queries will be routed to is running on the same machine as the router.</li>
<li><b>user</b> - The user name to use to log into the SQL Relay server that queries will be routed to is running on.</li>
<li><b>password</b> - The password to use to log into the SQL Relay server that queries will be routed to is running on.</li>
</ul>
<li><b>query</b></li>
<ul>
<li><b>pattern</b> - A regular expression.  Any query matching this regular expression will be routed to the SQL Relay server specified in the enclosing route tag.</li>
</ul>
</ul>

<p>Most of the tag attributes are straightforward.  The most complicated one
are the <b>metric</b> attribute of the <b>connection</b> tag and the 
<b>authtier</b> attribute of the <b>instance</b> tag.</p>

<span class="heading2">Metric</span><br><br>

<p>The <b>metric</b> attribute doesn't define how many connections are started, 
the <b>connections</b> attribute of the <b>instance</b> tag defines that.  The 
<b>metric</b> attribute influences how many of the total connections will be of
that connection type.  The higher the metric relative to the other metrics, the
more of that connection type will be started.</p>

<span class="heading2">Authtier</span><br><br>

<p>The client will send a user and password to the sqlr-listener and 
sqlr-connection daemons when it connects to them.  The <b>authtier</b> 
attribute indicates which daemon will actually pay attention to that user
and password.</p>

<p>If the <b>authtier</b> attribute is set to "listener", the sqlr-listener will
compare the user/password to the list of user/passwords in the sqlrelay.conf
file defined in the <b>users</b> tag and accept or reject the client connection.
If the client is accepted, it is handed off to the sqlr-connection-database
daemon which assumes that it has already been authenticated and does not perform
its own authentication.</p>

<p>If the <b>authtier</b> attribute is set to "connection", the sqlr-listener 
will ignore the user/password and just hand off the client to the 
sqlr-connection-database daemon which will compare the user/password to the 
list of user/passwords in the sqlrelay.conf file and accept or reject the 
client connection.</p>

<p>If the <b>authtier</b> attribute is set to "listener_and_connection" then 
both daemons will perform the authentication.  This is the most secure method
and the default but is slower than "listener" or "connection" alone.</p>

<p>If the <b>authtier</b> attribute is set to "database", the sqlr-listener
daemon will ignore the user/password and the sqlr-connection-database daemon
may use database-specific methods for authenticating and proxying the user.</p>

<p>When SQL Relay is used with Oracle 8i/9i, the sqlr-connection-database
daemon switches users without logging out.  The sqlr-connection-database 
daemon must be configured to log into the database as a user that can proxy 
other users and the client must attempt to log in to <b>SQL Relay</b> as one 
of the users that can be proxied.  See 
<a href="oraclentier.html">this document</a> for more information including
instructions for configuring Oracle.</p>

<p>When SQL Relay is used with any other database, it simply logs out and logs
back in as a different user.  This is quite ineffecient and defeats the 
value of keeping persistent database connections.</p>

<p><b>NOTE:</b> authtier="database" can't be used in an instance where
dbase="router".  It's OK for the instances that the router uses to use
authtier="database" but not the router instance itself.  If authtier="database"
is set on that instance, it will be overridden to
authier="listener_and_connection".</p>

<span class="heading2">Handoff</span><br><br>

<p>When an <b>SQL Relay</b> client needs to talk to the database, it connects
to a listener process which queues it up until a database connection daemon is
available.  When a daemon is available, the client is "handed off" to it.  This
"handoff" can be done in one of two ways.  The client can disconnect from the
listener and reconnect to the connection daemon, or the existing connection to 
the client can be passed from the listener to the connection daemon.  These two
methods are referred to as "reconnect" and "pass".  "Reconnect" works on every 
platform.  "Pass" works on most platforms but not all.  SCO OpenServer and 
Linux kernels prior to 2.2 don't support "pass".  Other platforms may not 
support "pass" as well but those certainly don't.  If <b>SQL Relay</b> is being
run on a different machine than its clients, "pass" is substantially faster 
than "reconnect" and more lightweight in any case.  It should be used if
possible.</p>

<span class="heading2">Debug</span><br><br>

<p>If the debug attribute is not set to "none", when <b>sqlr-start</b> is run,
it runs special versions of the <b>sqlr-listener</b> and 
<b>sqlr-connection</b> daemons which log debug information to files in 
/usr/local/firstworks/var/sqlrelay/debug.  When the daemons start up, they 
print out the exact filename that they are logging to.  This filename will be 
listener.PID or connection.PID where PID is the process ID of the daemon.  Note
that the <b>sqlr-listener</b> forks each time it gets a client connection and 
generates a seperate file for each forked process as well as one for the main 
process.</p>

<p>The debug attribute can be one of: "none", "listener", "connection" or 
"listener_and_connection".  If "none" is specified, no debugging information
is logged.  If "listener" is specified, then only the listener daemon logs 
debug information.  If "connection" is specified, then only the connection 
daemons log debug information.  If "listener_and_connection" is specified, all 
daemons log debug information.</p> 

</body>
</html>
